<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
		<title></title>
		<script src="../../../js/mui.min.js"></script>
		<script type="text/javascript" src="../../../js/world/NowWorld/main.js"></script>
		<link href="../../../css/mui.min.css" rel="stylesheet"/>
		<script type="text/javascript" charset="utf-8">
		  	mui.init();
			var buttonVar = "无";
		</script>
	</head>
	<body>
		<!-- 主界面菜单同时移动 -->
			<!-- 侧滑导航根容器 -->
		<div class="mui-off-canvas-wrap mui-draggable">
				<!-- 主页面容器 -->
			<div class="mui-inner-wrap">
					<!-- 菜单容器 -->
				<aside class="mui-off-canvas-left" id="offCanvasSide">
					<div class="mui-scroll-wrapper">
						<div class="mui-scroll">
							<!-- 菜单具体展示内容 -->
							<a href="../../../index.html"><button type="button" class="mui-btn mui-btn-blue mui-btn-block">回到主页</button></a>
							<a href="home.html"><button type="button" class="mui-btn mui-btn-purple mui-btn-block">自我</button></a>
							<a href="run.html"><button type="button" class="mui-btn mui-btn-grey mui-btn-block">发展</button></a>
							<a href="talk.html"><button type="button" class="mui-btn mui-btn-grey mui-btn-block">外交</button></a>
							<a href="cultrue.html"><button type="button" class="mui-btn mui-btn-grey mui-btn-block">文化</button></a>
							<a href="immortal.html"><button type="button" class="mui-btn mui-btn-grey mui-btn-block">仙魔</button></a>
							
						</div>
					</div>
				</aside>
					
				<header class="mui-bar mui-bar-nav"><!-- 主页面标题 -->
					<a class="mui-icon mui-action-menu mui-icon-bars mui-pull-left" href="#offCanvasSide"></a>
					<h1 class="mui-title">自我</h1>
				</header>
					<!-- 主页面内容容器 -->
				<div class="mui-content mui-scroll-wrapper">
					<div class="mui-scroll">
							<!-- 主界面具体展示内容 -->
						<ul class="mui-table-view">
							<li class="mui-table-view-cell mui-collapse">
								<a class="mui-navigate-right" href="#"><span class="mui-icon mui-icon-contact"></span>基础信息</a>
								<div class="mui-collapse-content">
									<div class="mui-row">
										<script type="text/javascript">//初始化数据
											setTimeout(function(){//初始化数据
												var dataErr = 0;//plus.storage.clear();
	
												if(plus.storage.getItem("Soul") != null){
													document.getElementById("Soul").innerHTML = "魂体:"+plus.storage.getItem("Soul");
												}else{dataErr = 1;}
												if(plus.storage.getItem("Race") != null){
													document.getElementById("Race").innerHTML = "种族:"+plus.storage.getItem("Race");
												}else{dataErr = 1;}
												if(plus.storage.getItem("Strongest") != null){
													document.getElementById("Strongest").innerHTML = "桎梏:"+plus.storage.getItem("Strongest");
												}else{dataErr = 1;}
												if(plus.storage.getItem("Fate") != null){
													document.getElementById("Fate").innerHTML = "气运:"+plus.storage.getItem("Fate");
												}else{dataErr = 1;}

												if(dataErr==1){//如果是新人或者报错,如果不是第一次进来就一定是有问题
													mui.alert('欢迎来到天书,一个放置挂机小游戏,点击确认开始你的游戏吧!<br>(如果您不是第一次进入,请赶紧关掉本软件,重新打开,以防止数据丢失.若您重新打开还是无效,请联系泪丘为您解决.)','欢迎来到天书','开始游戏',function(e){
														var d = new Date();
														var x = d.toLocaleDateString();
														plus.storage.setItem("Soul","无");
														plus.storage.setItem("Race","人");
														plus.storage.setItem("Strongest","练气后期");
														plus.storage.setItem("Fate","空");
														plus.storage.setItem("OneInDate",x);
														//个人修炼
														plus.storage.setItem("MyRealm","无");
														plus.storage.setItem("MyEnergy","40");
														plus.storage.setItem("MyMind","1");
														plus.storage.setItem("MyAge","50");
														plus.storage.setItem("MyVim","0");
														plus.storage.setItem("MyGuts","0");
														//领地资源
														plus.storage.setItem("MyAreaBig","0");
														plus.storage.setItem("MyAreaHasEnergy","0");
														plus.storage.setItem("MyAreaPlant","0");
														plus.storage.setItem("MyAreaMine","0");
														plus.storage.setItem("MyAreaBeast","0");
														plus.storage.setItem("MyAreaPulse","0");
														//领地人口资源
														plus.storage.setItem("FanRen","0");
														plus.storage.setItem("LianQi","0");
														plus.storage.setItem("ZhuJi","0");
														plus.storage.setItem("JinDan","0");
														plus.storage.setItem("YuanYing","0");
														//战斗属性
														plus.storage.setItem("MyVita","10");
														plus.storage.setItem("MyDamage","0");
														plus.storage.setItem("MyDefend","0");
														plus.storage.setItem("MyEnd","0");
														//外交部分
															//探索
														plus.storage.setItem("MyFindArea","0");
														plus.storage.setItem("MyCopyNum","0");
														e.index;//如果是转生啥的会设置好的,不会跳到这个条件语句进来的
													},'div');
												}
												document.getElementById("MyAge").innerHTML = plus.storage.getItem("MyAge");
												document.getElementById("MyEnergy").innerHTML = plus.storage.getItem("MyEnergy");
												document.getElementById("MyRealm").innerHTML = plus.storage.getItem("MyRealm");
												document.getElementById("MyMind").innerHTML = plus.storage.getItem("MyMind");
												document.getElementById("MyVim").innerHTML = plus.storage.getItem("MyVim");
												
												document.getElementById("MyVita").innerHTML = plus.storage.getItem("MyVita");
												document.getElementById("MyDamage").innerHTML = plus.storage.getItem("MyDamage");
												document.getElementById("MyDefend").innerHTML = plus.storage.getItem("MyDefend");
												document.getElementById("MyEnd").innerHTML = plus.storage.getItem("MyEnd");
												document.getElementById("MyGuts").innerHTML = plus.storage.getItem("MyGuts");
												DataAdd();
											},1000);
										</script>

										<div class="mui-col-sm-3 mui-col-xs-3"><p id="Soul" style="font-size: 80%;">魂体:无</p></div>
										<div class="mui-col-sm-3 mui-col-xs-3"><p id="Race" style="font-size: 80%;">种族:人</p></div>
										<div class="mui-col-sm-3 mui-col-xs-3"><p id="Strongest" style="font-size: 80%;">桎梏:练气圆满</p></div>
										<div class="mui-col-sm-3 mui-col-xs-3"><p id="Fate" style="font-size: 80%;">气运:空</p></div>
										<div class="mui-col-sm-3 mui-col-xs-3"><p id="#" style="font-size: 80%;">金灵根:0%</p></div>
										<div class="mui-col-sm-3 mui-col-xs-3"><p id="#" style="font-size: 80%;">木灵根:0%</p></div>
										<div class="mui-col-sm-3 mui-col-xs-3"><p id="#" style="font-size: 80%;">水灵根:0%</p></div>
										<div class="mui-col-sm-3 mui-col-xs-3"><p id="#" style="font-size: 80%;">火灵根:0%</p></div>
										<div class="mui-col-sm-3 mui-col-xs-3"><p id="#" style="font-size: 80%;">土灵根:0%</p></div>
										<div class="mui-col-sm-3 mui-col-xs-3"><p id="#" style="font-size: 80%;">风灵根:0%</p></div>
										<div class="mui-col-sm-3 mui-col-xs-3"><p id="#" style="font-size: 80%;">雷灵根:0%</p></div>
										<div class="mui-col-sm-3 mui-col-xs-3"><p id="#" style="font-size: 80%;">天灵根:0%</p></div>
									</div>
								</div>
							</li>
							<li class="mui-table-view-cell mui-collapse">
								<a class="mui-navigate-right" href="#">个人修行</a>
								<div class="mui-collapse-content">
									<div class="mui-row">
										<div class="mui-col-xs-6 mui-col-sm-6">境界:<b id="MyRealm">无</b></div>
										<div class="mui-col-xs-6 mui-col-sm-6">灵气:<b id="MyEnergy">0</b></div>
										<div class="mui-col-xs-6 mui-col-sm-6">道心:<b id="MyMind">0</b></div>
										<div class="mui-col-xs-6 mui-col-sm-6">寿元:<b id="MyAge">0</b></div>
										<div class="mui-col-xs-6 mui-col-sm-6">精力:<b id="MyVim">0</b></div><!--用于修炼功法等-->
										<div class="mui-col-xs-6 mui-col-sm-6">意志:<b id="MyGuts">0</b></div><!--用于突破桎梏等-->
										<div class="mui-col-xs-6 mui-col-sm-6"><button onclick="MyRealmUpButton()" type="button" class="mui-btn mui-btn-blue mui-btn-block mui-btn-outlined">尝试突破境界</button></div>
										<div class="mui-col-xs-6 mui-col-sm-6"><button onclick="MyRealmStrongUpButton()" type="button" class="mui-btn mui-btn-blue mui-btn-block mui-btn-outlined">突破境界桎梏</button></div>
										<script type="text/javascript">//上方按钮事件
											//尝试突破境界按钮(未完成)
											function MyRealmUpButton(){
												if(buttonVar!="尝试突破境界"){
													if(plus.storage.getItem("MyRealm")==plus.storage.getItem("Strongest")){
														document.getElementById("tip1").innerHTML="达到境界桎梏,突破境界桎梏后再来";
													}else{
													document.getElementById("tip1").innerHTML="尝试突破境界:突破,当前需要灵气:"+MyRealmUpEnergyHelp(plus.storage.getItem("MyRealm"));
													buttonVar="尝试突破境界";}
												}else{//确定突破
													buttonVar="无";
													switch(MyRealmUp()){
														case 1:
															document.getElementById("tip1").innerHTML="灵力不够啊小伙子(每10s加一次灵气)";
															break;
														case 2:
															document.getElementById("tip1").innerHTML="突破失败,失去突破所需10%灵力";
															plus.storage.setItem("MyEnergy",String(Number(plus.storage.getItem("MyEnergy"))-(MyRealmUpEnergyHelp(plus.storage.getItem("MyRealm"))/10)));
															document.getElementById("MyEnergy").innerHTML=plus.storage.getItem("MyEnergy");
															break;
														case 3:
															document.getElementById("tip1").innerHTML="突破成功!";
															plus.storage.setItem("MyEnergy",String(Number(plus.storage.getItem("MyEnergy"))-MyRealmUpEnergyHelp(plus.storage.getItem("MyRealm"))));//灵力消耗
															document.getElementById("MyEnergy").innerHTML=plus.storage.getItem("MyEnergy");
															plus.storage.setItem("MyRealm",MyRealmSccess(plus.storage.getItem("MyRealm")));//境界改变
															document.getElementById("MyRealm").innerHTML=plus.storage.getItem("MyRealm");
															plus.storage.setItem("MyAge",String(Number(plus.storage.getItem("MyAge"))+MyRealmUpLifeUp(plus.storage.getItem("Race"),plus.storage.getItem("MyRealm"))));//寿命提升
															document.getElementById("MyAge").innerHTML=plus.storage.getItem("MyAge");
															MyRealmUpDamgeUp();
															break;
														default:
															alert("升级出现问题,请退出重新进入,避免数据丢失");
															break;
														}
												}
											}
											//突破境界桎梏按钮(未完成)
											function MyRealmStrongUpButton(){
												if (buttonVar!="突破境界桎梏") {
													buttonVar="突破境界桎梏";
													document.getElementById("tip1").innerHTML = "突破桎梏,逆天之路!";
													document.getElementById("tip2").innerHTML = '<b style="color:red;">突破桎梏会有巨大损失,谨慎突破!</b>';
												} else{
													if(plus.storage.getItem("MyRealm")==plus.storage.getItem("Strongest")){
													buttonVar = "无";
													mui('#sheet1').popover('toggle');
													}else{
														document.getElementById("tip1").innerHTML = "当前未抵达境界桎梏";
														console.log(plus.storage.getItem("MyRealm")+plus.storage.getItem("Strongest"));
													}
												}
											}
										</script>
									</div>
								</div>
							</li>
							<li class="mui-table-view-cell mui-collapse">	
								<a class="mui-navigate-right" href="#">基础活动</a>
								<div class="mui-collapse-content">
									<div class="mui-row">
										<div class="mui-col-xs-4 mui-col-sm-4"><a href="home/refiner.html"><button type="button" class="mui-btn mui-btn-blue mui-btn-block mui-btn-outlined">炼器</button></a></div>
										<div class="mui-col-xs-4 mui-col-sm-4"><button type="button" class="mui-btn mui-btn-blue mui-btn-block mui-btn-outlined">炼丹</button></div>
										<div class="mui-col-xs-4 mui-col-sm-4"><button type="button" class="mui-btn mui-btn-blue mui-btn-block mui-btn-outlined">制符</button></div>
										<div class="mui-col-xs-4 mui-col-sm-4"><button type="button" class="mui-btn mui-btn-blue mui-btn-block mui-btn-outlined">布阵</button></div>
										<div class="mui-col-xs-4 mui-col-sm-4"><button type="button" class="mui-btn mui-btn-blue mui-btn-block mui-btn-outlined">功法</button></div>
										<div class="mui-col-xs-4 mui-col-sm-4"><button type="button" class="mui-btn mui-btn-blue mui-btn-block mui-btn-outlined">灵宠</button></div>
									</div>
								</div>
							</li>
							<li class="mui-table-view-cell mui-collapse">
								<a class="mui-navigate-right" href="#">战斗能力</a>
								<div class="mui-collapse-content">
									<div class="mui-row">
										<div class="mui-col-xs-6 mui-col-sm-6"><p>生命:<b id="MyVita">10</b></p></div>
										<div class="mui-col-xs-6 mui-col-sm-6"><p>攻击:<b id="MyDamage">0</b></p></div>
										<div class="mui-col-xs-6 mui-col-sm-6"><p>防御:<b id="MyDefend">0</b></p></div>
										<div class="mui-col-xs-6 mui-col-sm-6"><p>斩杀:<b id="MyEnd">0</b></p></div>
									</div>
								</div>
							</li>
						</ul>
						<h4>提示栏:</h4>
							<p id="tip1">只有在本页时间是进行的</p>
						<h4>消息栏:</h4>
							<p id="tip2">如果数据不显示,回到主页再过来就好了</p>
						<h4>机遇栏:</h4>
							<p id="tip3">暂无内容</p>
					</div>
					
				</div>
				
			</div>
		</div>
		<!--突破境界桎梏-->
		<div id="sheet1" class="mui-popover mui-popover-bottom mui-popover-action">
			<!-- 可选择菜单 -->
			<div class="mui-card">
				<!--页眉，放置标题-->
				<div class="mui-card-header">突破选择:</div>
			</div>
			<ul class="mui-table-view">
			  <b onclick="MyRealmStrongUp(0)"><li class="mui-table-view-cell">
				灵气护体
			  </li></b>
			  <b onclick="/*MyRealmStrongUp(1)*/"><li class="mui-table-view-cell">
				挡灾金鱼(未开放)
			  </li></b>
			  <b onclick="/*MyRealmStrongUp(2)*/"><li class="mui-table-view-cell">
			  	战天道(未开放)
			  </li></b>
			</ul>
			<!-- 取消菜单 -->
			<ul class="mui-table-view">
			  <li class="mui-table-view-cell">
				<a href="#sheet1"><b>再想想</b></a>
			  </li>
			</ul>
			
		</div>
	</body>
</html>